package com.findtech.threePomelos.entity;

import android.text.TextUtils;

/**
 * Created by lenovo on 2016/4/30.
 */
public class TravelInfoEntity {

    private String todayMileage;
    private String totalMileage;
    private String averageSpeed;
    private static TravelInfoEntity travelInfoEntity;

    public TravelInfoEntity() {
    }

    public static TravelInfoEntity getInstance() {
        if (travelInfoEntity == null) {
            travelInfoEntity = new TravelInfoEntity();
        }
        return travelInfoEntity;
    }

    public String getTodayMileage() {
        if (TextUtils.isEmpty(todayMileage)) {
            return "0.0";
        } else {
            return todayMileage;
        }
    }

    public void setTodayMileage(String todayMileage) {
        if (TextUtils.isEmpty(todayMileage)) {
            this.todayMileage = "0.0";
        } else {
            this.todayMileage = todayMileage;
        }
    }

    public String getTotalMileage() {
        if (TextUtils.isEmpty(totalMileage)) {
            return "0.0";
        } else {
            return totalMileage;
        }
    }

    public void setTotalMileage(String totalMileage) {
        this.totalMileage = totalMileage;
    }

    public String getAverageSpeed() {
        if (TextUtils.isEmpty(averageSpeed)) {
            return "0.0";
        } else {
            return averageSpeed;
        }
    }

    public void setAverageSpeed(String averageSpeed) {
        if (TextUtils.isEmpty(todayMileage)) {
            this.averageSpeed = "0.0";
        } else {
            this.averageSpeed = averageSpeed;
        }
    }
}
